{template header}

<div class="container">

    <div class="row">
        <div class="col-md-8">
            {template menu}

            <div class="panel panel-default">
                <div class="panel-body">



                    {if intval($TS_USER['userid']) >0 && intval($TS_USER['userid']) != $strUser['userid']}
                    <div class="guest">
                        <img src="{SITE_URL}public/images/user_normal.jpg" />
                        <form method="post" action="{SITE_URL}index.php?app=user&ac=guestbook&ts=do">
                            <textarea class="form-control" name="content"></textarea>

                            <input type="hidden" name="touserid" value="{$strUser['userid']}" />
                            <input type="hidden" name="token" value="{$_SESSION['token']}" />

                            <div class="pd100">
                                <button class="btn btn-success" type="submit">添加留言</button>
                            </div>



                        </form>
                    </div>
                    {/if}
                    <div class="clear"></div>

                    <!--回复-->
                    <div id="reguest" style="display:none;">
                        <form method="post" action="{SITE_URL}index.php?app=user&ac=guestbook&ts=redo">
                            <textarea class="form-control" name="content"></textarea>

                            <input id="touserid" type="hidden" name="touserid" value="0" />
                            <input id="reid" type="hidden" name="reid" value="0" />

                            <div class="pd100">
                                <button class="btn btn-success" type="submit">回复</button>
                            </div>

                        </form>
                    </div>

                    <div class="glist">
                        <ul>

                            {loop $arrGuestList $key $item}
                            <li>
                                <a href="{tsUrl('user','space',array('id'=>$item['userid']))}" rel="face" uid="{$item['user']['userid']}">
                                    <img src="{$item['user']['face']}" width="48" height="48" class="img-circle" />
                                </a>
                                <div class="content">
                                    <p><a href="{tsUrl('user','space',array('id'=>$item['userid']))}"  rel="face" uid="{$item['user']['userid']}">{$item['user']['username']}</a> {$item['addtime']}</p>
                                    <div>{php echo tsDecode($item['content'])}</div>
                                    <p style="text-align:right">
                                        {if intval($TS_USER['userid'] == $strUser['userid'])}
                                        <a href="#reguest" onclick="reguest('{$item['userid']}','{$item['id']}')">回复</a> <a href="{tsUrl('user','guestbook',array('ts'=>'delete','gbid'=>$item['id']))}" onclick="return confirm('确定删除?')">删除</a>
                                        {/if}
                                    </p>
                                    <!--回复留言-->

                                </div>
                            </li>
                            {/loop}
                        </ul>
                    </div>

                    <div class="clear"></div>
                    <div class="page">{$pageUrl}</div>

                </div>
            </div>
        </div>

        <div class="col-md-4">
            {template userinfo}
        </div>

    </div>
</div>
{template footer}